<?php header("Content-type: text/plain; charset=iso-8859-1");?>
<?php echo"<?php xml version=\"1.0\" encoding=\"iso-8859-1\"?>";?> 
<?php
        function calculport($poids){
 			return 0;
    	}

?>
<?php 
	$ladate = date("Y-m-d H:i");
?>
<catalog lang="FR" date="<?php echo($ladate); ?>">
<?php

	require_once("../../classes/Produit.class.php");
	require_once("../../classes/Image.class.php");
	require_once("../../classes/Rubrique.class.php");
	require_once("../../classes/Variable.class.php");

	$i=0;
	
	$produit = new Produit();	
	$produitdesc = new Produitdesc();
	$rubrique = new Rubrique();
	$rubriquedesc = new Rubriquedesc();

	$image = new Image();
	$urlsite = new Variable("urlsite");
	 
	$query = "select * from $produit->table where ligne='1'";
	$resul = mysql_query($query, $produit->link);

	while($row = mysql_fetch_object($resul)){

		$produitdesc->charger($row->id);
		
		$query2 = "select * from $image->table where produit='$row->id'";
		$resul2 = mysql_query($query2, $image->link);
		$row2 = mysql_fetch_object($resul2);
		$i++;

        $description = str_replace("\r\n", " ", $produitdesc->description);	
		$description = str_replace("\n", " ", $description);	
   		$description = str_replace("<br>", "<br />", $description);	
   		$description = str_replace("<BR>", "<br />", $description);	
   		$description = str_replace("\n", " ", $description);	
		$description = str_replace("<br />", " ", $description);	
        $description = strip_tags($description);
	
		$description = trim($description);

		$rubriquedesc->charger($row->rubrique);		
		
?>

	<product num="<?php echo($i); ?>">
		<refinternal><![CDATA[ <?php echo($row->ref); ?>]]></refinternal>
		<category><![CDATA[ <?php echo($rubriquedesc->titre); ?>]]></category>
		<designation><![CDATA[ <?php echo($produitdesc->titre); ?>]]></designation>
		<description><![CDATA[ <?php echo($description); ?> ]]></description>
		<brand></brand>
		<price><?php echo($row->prix2); ?></price>
		<url><![CDATA[ http://<?php echo $urlsite->valeur; ?>/produit.php?ref=<?php echo($row->ref); ?>]]></url>
		<img><![CDATA[ http://<?php echo $urlsite->valeur; ?>/fonctions/redimlive.php?nomorig=../client/gfx/photos/produit/<?php echo($row2->fichier); ?>&width=70&height=70]]></img>
	</product>
	
	
<?php	}	?>

</catalog>
